//
//  CJRecTitleTableViewCell.m
//  CoJellyCartoon
//
//  Created by dllo on 16/4/1.
//  Copyright © 2016年 CJG. All rights reserved.
//

#import "CJRecTitleTableViewCell.h"

@implementation CJRecTitleTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor colorWithRed:239/255.0 green:239/255.0 blue:244/255.0 alpha:1];
        self.HeaderTitle = [[CJBaseLabel alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:self.HeaderTitle];
//        self.regionButton = [[UIButton alloc] initWithFrame:CGRectZero];
//        self.regionButton.backgroundColor = [UIColor lightGrayColor];
//        self.regionButton.titleLabel.font = [UIFont systemFontOfSize:15];
//        self.regionButton.layer.cornerRadius = 10;
//        [self.contentView addSubview:self.regionButton];
    }
    
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.HeaderTitle.frame = CGRectMake(5, 10, 70, 30);
    self.regionButton.frame = CGRectMake(self.contentView.bounds.size.width - 100, 10, 90, 30);
}

-(void)setHeadModel:(CJRECHeadModel *)headModel{
    _headModel = headModel;
    self.HeaderTitle.text = headModel.title;
    
    if ([headModel.title isEqualToString:@"热门焦点"]) {
        [self.regionButton setImage:[[UIImage imageNamed:@"iconfont-paixingbang-2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
        [self.regionButton setTitle:@"排行榜" forState:UIControlStateNormal];
    }else  if (![headModel.title isEqualToString:@"热门焦点"]){
//        
//        [self.regionButton setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
//        [self.regionButton setTitle:@"进去看看" forState:UIControlStateNormal];
    }
    
}
@end
